<?php
if ( !defined( "IN_OP" ) )
{
    exit( "You can't access this file directly..." );
}
require_once( "class_3d/CheckMode_3d.php" );
$gametype = intval( getvar( "gametype" ) );
$chkGametype = chkGametype( $gametype );
$chk = new CheckMode_3d( $curruser['acl'], 1, $gametype );
$chk->checkShow3dPage();
unset( $chk );
$tbl = $g_gametype_3d[$gametype]['en'];
$tblName = $g_gametype_3d[$gametype]['ch'];
if ( $curruser['acl'] != "255" )
{
    exit();
}
$lotto_id = intval( getvar( "lotto_id" ) );
$conf = new Config();
if ( $chkGametype == 3 )
{
    require( "class_5h/Bet_5h.php" );
    $Bet_3d = new Bet_5h( $gametype );
}
else
{
    require( "class_3d/Bet_3d.php" );
    $Bet_3d = new Bet_3d( $gametype );
}
$time = strtotime( "-7 seconds" );
$checkVal = $conf->get( "max_bat_hint_{$tbl}" ) - 1;
$rs = $Bet_3d->getBigBetListRS( $lotto_id, $checkVal, $time );
$tempStr = "{\"msg\":\"OK\"";
$tempStr .= ",\"betDate\":[";
if ( $rs->eof )
{
    $tempStr .= "\"nodata\"";
}
else
{
    $tempStr .= "\"getData\"";
    $_SESSION["time3DCK".$gametype] = $time;
}
$tempStr .= "]}";
header( "Cache-Control: no-cache, must-revalidate" );
header( "Content-Type: text/plain" );
echo $tempStr;
exit();
?>